<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">

</head>
<body>
<p>
<form action="/dept/list/1" method="post">
    <div class="layui-form-item">
        <div class="layui-inline">
            <a class="layui-btn layui-bg-blue" href="/dept/toadd">增加员工</a>

            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入姓名" name="dname" value="${condition.dname}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
            </div>
            <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
        </div>
    </div>

</form>

</p>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col>
    </colgroup>
    <thead>
    <tr>
        <%--        <th>编号</th>--%>
        <th>id</th>
        <th>姓名</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${depts}" var="dept">
        <tr>
            <td>${dept.id}</td>
            <td>${dept.dname}</td>
            <td>
                <a href="/dept/toupdate/${dept.id}">修改</a>
                <a href="/dept/delete/${dept.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="4">
            <a href="/dept/list/1">首页</a>
            <c:if test="${page.currentPage!=1}">
                <a href="/dept/list/${page.currentPage-1}">上一页</a>
            </c:if>
            第${page.currentPage}页/总${page.totalPage}页
            <c:if test="${page.currentPage!=page.totalPage}">
                <a href="/dept/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/dept/list/${page.totalPage}">末页</a>
        </td>
    </tr>
    </tbody>
    <%--一个功能三个页面 list add delete 修改写在查询里面--%>
</table>
</body>
</html>
